<?php
namespace model;
use model;
class bannerModel extends model{


    public static function findByName( $name ){
        $sql = "select * from sh_banner where `status`='1' and name ='" . $name . "'";
        $result = self::$db->query( $sql );
        return !empty($result->row)?$result->row:false;
    }

    public static function findImageById( $banner_id ){
        $sql = "select * from sh_banner_image where banner_id ='" . $banner_id . "'";
        $result = self::$db->query( $sql );
        return $result->rows;
    }

}